#!/bin/sh

if [ -n "$1" ]; then
    data_date=$1
else
  data_date=$(date -d "-1 days" +%F)
fi

LOAD_DATA_PROVINCE="
    load data inpath '/fu/sqoop/jtp_app_shujuku/t_md_areas/${data_date}'
        overwrite into table jtp_app_ods.ods_md_areas partition (dt='${data_date}');"

/opt/module/spark/bin/beeline -u jdbc:hive2://node101:10001 -n bwie -e "${LOAD_DATA_PROVINCE}"
